package pl.edu.pw.MidEmu.Base.Components;

import java.awt.Component;

import pl.edu.pw.MidEmu.Base.Controllers.BaseController;
import pl.edu.pw.MidEmu.Base.Views.BaseView;

/**
 * Base component used by all GUI frames
 * 
 * @author Mateusz Starodab
 *
 * @param <T1> A Java GUI component like frame or dialog box
 * @param <T2> Controller used by this component
 */
public class BaseFrame<T1 extends Component, T2 extends BaseController<? extends BaseView>>
{
	/**
	 * GUI component
	 */
	private T1 component;
	
	/**
	 * Controller managing this component
	 */
	private T2 controller;

	/**
	 * Returns GUI component
	 * @return GUI component
	 */
	public T1 getComponent()
	{
		return component;
	}

	/**
	 * Returns controller
	 * @return controller
	 */
	public T2 getController()
	{
		return controller;
	}

	/**
	 * Sets component
	 * @param component Component to be set
	 */
	public void setComponent(T1 component)
	{
		this.component = component;
	}

	/**
	 * Sets controller
	 * @param controller Controller to be set
	 */
	public void setController(T2 controller)
	{
		this.controller = controller;
	}
}
